<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class HelperServiceProvider extends ServiceProvider
{

    protected $helpers = [
        // Add your helpers in here
        'helpers'
    ];

    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
//        $this->register();
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        if ($this->helpers && is_array($this->helpers) && count($this->helpers) > 0){
            foreach ($this->helpers as $helper) {
                $helper_path = app_path() . '/Helpers/' . $helper . '.php';
                if (\File::isFile($helper_path)) {
                    require_once $helper_path;
                }
            }
        }
    }
}
